from PySide import QtGui
import g_filemenu
import g_editmenu

class MenuBar():
	
	def __init__(self, parent):
		self.parent = parent
		self.initUI(parent.menuBar())
	
	def initUI(self, menubar):
		self.initFileMenu(menubar.addMenu("&File"))
		self.initEditMenu(menubar.addMenu("&Edit"))
		#self.initViewMenu(menubar.addMenu("&View"))
		#self.initToolsMenu(menubar.addMenu("&Tools"))
		#self.initHelpMenu(menubar.addMenu("&Help"))
	
	def initFileMenu(self, filemenu):
		filemenu.addAction(g_filemenu.fileNew(self.parent))
		filemenu.addAction(g_filemenu.fileOpen(self.parent))
		filemenu.addSeparator()
		filemenu.addAction(g_filemenu.fileSave(self.parent))
		filemenu.addAction(g_filemenu.fileSaveAs(self.parent))
		filemenu.addSeparator()
		filemenu.addAction(g_filemenu.exit(self.parent))
		
	def initEditMenu(self, editmenu):
		editmenu.addAction(g_editmenu.editNodes(self.parent))
		editmenu.addAction(g_editmenu.editMembers(self.parent))
		editmenu.addSeparator()
		editmenu.addAction(g_editmenu.editMaterials(self.parent))
		editmenu.addAction(g_editmenu.editFields(self.parent))
		editmenu.addAction(g_editmenu.editBoundaries(self.parent))
		editmenu.addAction(g_editmenu.editLoads(self.parent))
		editmenu.addSeparator()
		editmenu.addAction(g_editmenu.editSettings(self.parent))
		
	def initViewMenu(self, viewmenu):
		pass
		
	def initToolsMenu(self, toolsmenu):
		pass
		
	def initHelpMenu(self, helpmenu):
		pass
